import Axios from "../utils/axios";
import api from "../api/index";

//同意申请
function applyAgree(agreeData){
    return Axios.post(api.ApprovalOfBteApi.applyAgree,agreeData)//申请数据的id  申请的数据的当前状态
}

//拒绝申请
function applyRefuse(ids,refuseCause){
    return Axios.post(api.ApprovalOfBteApi.applyRefuse,{id:ids,refuseCause})//	申请数据的id   拒绝原因
}

//审批人更换
function applyPerson(ids,number){
    return Axios.post(api.ApprovalOfBteApi.applyPerson,{ids,number})//申请数据的id  申请的数据的当前状态
}

//借出
function applyList(aoid,limit,page,name) {
    return Axios.post(api.ApprovalOfBteApi.applyList,{aoid,limit,page,name})
}

//挂失
function applyLose(aoid,limit,page,name,loseDate){
    return Axios.post(api.ApprovalOfBteApi.applyLose,{aoid,limit,page,name,loseDate})//	审批人ID 条数  页码
}

//报修
function applyRepairs(aoid,limit,page,name){
    return Axios.post(api.ApprovalOfBteApi.applyRepairs,{aoid,limit,page,name})//	审批人ID 条数  页码  修理时间
}

//报废
function applyScrap(aoid,limit,page,name){
    return Axios.post(api.ApprovalOfBteApi.applyScrap,{aoid,limit,page,name})//	审批人ID 条数  页码  报废时间
}

//领用
function applyConsumable(aoid,limit,page,name){
    return Axios.post(api.ApprovalOfBteApi.applyConsumable,{aoid,limit,page,name})//	审批人ID 条数  页码  报废时间
}

//核销
function applyWrite(aoid,limit,page,name){
    return Axios.post(api.ApprovalOfBteApi.applyWrite,{aoid,limit,page,name})//	审批人ID 条数  页码  报废时间
}
   //return Axios.get(api.ApprovalOfBte.ApprovalOfBte+"/"+params)
 
//教学设备撤回申请
function applicantFacilityDelete(id){
    return Axios.delete(api.ApprovalOfBteApi.applicantFacilityDelete+"?id="+id)
}


//教学设备查询详情
function applicantFacilityPage(id,limit,page,name){
    return Axios.post(api.ApprovalOfBteApi.applicantFacilityPage,{id,limit,page,name})
}

//提交借入申请
function applicantBorrow(id,leaseDesc,leaseNum,leaseTime,returnTime,usableNum){
    return Axios.post(api.ApprovalOfBteApi.applicantBorrow,{id,leaseDesc,leaseNum,leaseTime,returnTime,usableNum})
}

//发起借入申请
function applicantPage(limit,page){
    return Axios.post(api.ApprovalOfBteApi.applicantPage,{limit,page})
}

export default{
    applyAgree,
    applyList,
    applyRefuse,
    applyLose,
    applyPerson,
    applyRepairs,
    applyScrap,
    applyConsumable,
    applyWrite,
    applicantFacilityDelete,
    applicantFacilityPage,
    applicantPage,
    applicantBorrow

}